//
//  ViewController.m
//  LNTextView
//
//  Created by KuiYin on 15/11/5.
//  Copyright © 2015年 shenming. All rights reserved.
//

#import "ViewController.h"
#import "LNTextView.h"

@interface ViewController ()<LNTextViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    LNTextView *textView = [[LNTextView alloc]initWithWidth:250 maxHeight:150];
    //    LNTextView *textView = [[LNTextView alloc]init];
//        textView.font = [UIFont systemFontOfSize:25];
    //    textView.textContainerInset = UIEdgeInsetsMake(20, 20, 0, 20);
    textView.frame = CGRectMake(10, 50, 100, 100);
    textView.placeholder = @"提示字段";
    textView.lnDelegate = self;
    textView.placeholderColor = [UIColor redColor];
    textView.backgroundColor = [UIColor lightGrayColor];
    [self.view addSubview:textView];
}

- (void)textViewDidEndEditing:(UITextView *)textView
{
    NSString *str = [textView.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
    NSLog(@"str---%@",str);
}

- (void)textViewDidChange:(UITextView *)textView
{
    NSString *str = [textView.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
    NSLog(@"str---%@",str);
}


@end
